package com.party.core.model.member;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * 商户配置类型枚举
 * Created by wei.li.
 *
 * @date 2018/1/23 0023
 * @time 11:35
 */
public enum DeployType {

    AUTHORIZATION(0, "授权配置"),

    FILL_IN(1, "填写配置");

    //状态码
    private Integer code;

    //状态值
    private String value;

    DeployType(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static String getValue(Integer code){
        for (DeployType deployType : DeployType.values()){
            if (deployType.getCode().equals(code)){
                return deployType.getValue();
            }
        }
        return null;
    }

    public static Map<Integer, String> convertMap(){
        Map<Integer, String> map = Maps.newHashMap();
        for (DeployType deployType : DeployType.values()){
            map.put(deployType.getCode(), deployType.getValue());
        }
        return map;
    }

}
